<!--
/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * Copyright 2014 The moOde audio player project / Tim Curtis
 *
 * 汉化：Androidnews
 *
*/
-->
<div id="container">
<div class="container">
	<h1 class="per-config">Peripherals</h1>

	<form class="form-horizontal" method="post">
		<div class="control-group $_feat_localui">
		<legend>本地显示</legend>

<label class="control-label">显示</label>
<div class="controls">
    <div class="toggle">
        <label class="toggle-radio toggle-localui" for="toggle-localui-2">开启 </label>$_select[localui_on]
        <label class="toggle-radio toggle-localui" for="toggle-localui-1">关闭</label>$_select[localui_off]
    </div>
    <button id="btn-set-localui" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_localui" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
    <a aria-label="帮助" class="config-info-toggle" data-cmd="info-localui" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
    <span id="info-localui" class="config-help-info">
        在本地连接的显示器上显示 moOde 界面。
    </span>
</div>

<label class="control-label">播放时唤醒</label>
<div class="controls">
    <div class="toggle">
        <label class="toggle-radio toggle-wake-display" for="toggle-wake-display-2">开启 </label>$_select[wake_display_on]
        <label class="toggle-radio toggle-wake-display" for="toggle-wake-display-1">关闭</label>$_select[wake_display_off]
    </div>
    <button id="btn-set-wake-display" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_wake_display" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
    <a aria-label="帮助" class="config-info-toggle" data-cmd="info-wake-display" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
    <span id="info-wake-display" class="config-help-info">
        当音频开始播放时唤醒显示器。
    </span>
</div>


		<label class="control-label">鼠标光标</label>
<div class="controls">
    <div class="toggle">
        <label class="toggle-radio toggle-touchscn" for="toggle-touchscn-2">开启 </label>$_select[touchscn_on]
        <label class="toggle-radio toggle-touchscn" for="toggle-touchscn-1">关闭</label>$_select[touchscn_off]
    </div>
    <button id="btn-set-touchscn" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_touchscn" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
    <a aria-label="帮助" class="config-info-toggle" data-cmd="info-touchscn" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
    <span id="info-touchscn" class="config-help-info">
        这将防止光标在显示器或触摸屏上显示
    </span>
</div>

<label class="control-label">弹出键盘</label>
<div class="controls">
    <div class="toggle">
        <label class="toggle-radio toggle-on-screen-kbd" for="toggle-on-screen-kbd-2">开启 </label>$_select[on_screen_kbd_on]
        <label class="toggle-radio toggle-on-screen-kbd" for="toggle-on-screen-kbd-1">关闭</label>$_select[on_screen_kbd_off]
    </div>
    <button id="btn-set-on-screen-kbd" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_on_screen_kbd" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
    <a aria-label="帮助" class="config-info-toggle" data-cmd="info-on-screen-kbd" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
    <span id="info-on-screen-kbd" class="config-help-info">
        屏幕弹出键盘，由 @Nutul 提供。
    </span>
</div>

<label class="control-label" for="scnblank">屏幕空白</label>
<div class="controls">
    <select id="scnblank" class="config-select-large" name="scnblank" onchange="autoClick('#btn-set-scnblank');" $_ctl_disabled>
        $_select[scnblank]
    </select>
    <button id="btn-set-scnblank" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_scnblank" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
    <a aria-label="帮助" class="config-info-toggle" data-cmd="info-scnblank" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
    <span id="info-scnblank" class="config-help-info">
        播放停止后，显示将在指定时间后关闭。
    </span>
</div>


		<div class="controls">
    <button class="btn btn-primary btn-medium config-btn btn-submit" type="submit" name="update_toggle_coverview" value="novalue" $_ctl_disabled>切换</button>
    <span class="config-btn-after">封面视图</span>
    <span class="config-help-static">
        封面视图状态: $_coverview_onoff
    </span>
</div>

<div class="controls">
    <a data-toggle="modal" href="#restart-localui" $_link_disabled>
        <button class="btn btn-medium btn-primary config-btn" $_ctl_disabled>重启</button>
    </a>
    <span class="config-btn-after">本地显示</span>
</div>

<label class="control-label">HDMI CEC 控制</label>
<div class="controls">
    <div class="toggle">
        <label class="toggle-radio toggle-hdmi-cec" for="toggle-hdmi-cec-2">开启 </label>$_select[hdmi_cec_on]
        <label class="toggle-radio toggle-hdmi-cec" for="toggle-hdmi-cec-1">关闭</label>$_select[hdmi_cec_off]
    </div>
    <button id="btn-set-hdmi-cec" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_hdmi_cec" value="novalue" $_hdmi_cec_btn_disable>
        <i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i>
    </button>
    <a aria-label="帮助" class="config-info-toggle" data-cmd="info-hdmi-cec" href="#notarget">
        <i class="fa-regular fa-sharp fa-info-circle"></i>
    </a>
    <span id="info-hdmi-cec" class="config-help-info">
        当 moOde 启动或在播放时唤醒时自动打开显示器。在 moOde 关闭时关闭显示器。
    </span>
</div>

		<label class="control-label">HDMI 4K 60Hz</label>
<div class="controls">
    <div class="toggle">
        <label class="toggle-radio toggle-hdmi-enable-4kp60" for="toggle-hdmi-enable-4kp60-2">开启 </label>$_select[hdmi_enable_4kp60_on]
        <label class="toggle-radio toggle-hdmi-enable-4kp60" for="toggle-hdmi-enable-4kp60-1">关闭</label>$_select[hdmi_enable_4kp60_off]
    </div>
    <button id="btn-set-hdmi-enable-4kp60" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_hdmi_enable_4kp60" value="novalue" $_hdmi_4kp60_btn_disable><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
    <a aria-label="帮助" class="config-info-toggle" data-cmd="info-hdmi-enable-4kp60" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
    <span id="info-hdmi-enable-4kp60" class="config-help-info">
        默认情况下，连接到4K显示器时，Raspberry Pi 4B、400和CM4将选择30Hz刷新率。使用此选项可以选择60Hz刷新率。
    </span>
</div>
</div>

<div class="control-group">
    <legend>树莓派7英寸触摸屏</legend>

    <label class="control-label" for="scnbrightness">亮度</label>
    <div class="controls">
        <input class="config-input-large" type="number" maxlength="3" min="0" max="255" id="scnbrightness" name="scnbrightness" value="$_select[scnbrightness]" $_ctl_disabled>
        <button class="btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_scnbrightness" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
        <a aria-label="帮助" class="config-info-toggle" data-cmd="info-brightness" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
        <span id="info-brightness" class="config-help-info">
            7英寸触摸屏的背光亮度。值范围为0 - 255。
        </span>
    </div>

			<!-- No solution with KMS driver as of r902 -->
			<!--label class="control-label" for="pixel-aspect-ratio">Pixel aspect ratio</label>
			<div class="controls">
				<select id="pixel-aspect-ratio" class="config-select-large" name="pixel_aspect_ratio" onchange="autoClick('#btn-set-pixel-aspect-ratio');" $_ctl_disabled>
					$_select[pixel_aspect_ratio]
				</select>
				<button id="btn-set-pixel-aspect-ratio" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_pixel_aspect_ratio" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info_pixel_aspect_ratio" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info_pixel_aspect_ratio" class="config-help-info">
					Rectangular (default) or square pixels for 7" Pi Touch.
                </span>
			</div-->
    <label class="control-label" for="scnrotate">旋转屏幕</label>
    <div class="controls">
        <select id="scnrotate" class="config-select-large" name="scnrotate" onchange="autoClick('#btn-set-scnrotate');" $_ctl_disabled>
            $_select[scnrotate]
        </select>
        <button id="btn-set-scnrotate" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_scnrotate" value="novalue" $_ctl_disabled><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
    </div>
</div>


	<div class="control-group">
    <legend>音量控制器</legend>

    <label class="control-label">USB 音量旋钮</label>
    <div class="controls">
        <div class="toggle">
            <label class="toggle-radio toggle-usb-volknob" for="toggle-usb-volknob-2">开启</label>$_select[usb_volknob_on]
            <label class="toggle-radio toggle-usb-volknob" for="toggle-usb-volknob-1">关闭</label>$_select[usb_volknob_off]
        </div>
        <button id="btn-set-usb-volknob" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_usb_volknob" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
        <a aria-label="帮助" class="config-info-toggle" data-cmd="info_usb_volknob" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
        <span id="info_usb_volknob" class="config-help-info">
            启动 USB 音量旋钮的触发映射守护进程。<br>
            参考 /etc/triggerhappy/triggers.d/media.conf 以获取键位/事件映射。
        </span>
    </div>

    <label class="control-label">旋转编码器</label>
    <div class="controls">
        <div class="toggle">
            <label class="toggle-radio toggle-rotaryenc" for="toggle-rotaryenc-2">开启</label>$_select[rotaryenc_on]
            <label class="toggle-radio toggle-rotaryenc" for="toggle-rotaryenc-1">关闭</label>$_select[rotaryenc_off]
        </div>
        <button id="btn-set-rotaryenc" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_rotenc" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
        <a aria-label="帮助" class="config-info-toggle" data-cmd="info-rotaryenc" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
        <span id="info-rotaryenc" class="config-help-info">
            启用旋转编码器设备以控制 MPD 音量。
        </span>
    </div>

    <label class="control-label" for="rotenc-params">编码器设置</label>
    <div class="controls">
        <input class="config-input-large" type="text" id="rotenc-params" name="rotenc_params" value="$_select[rotenc_params]" required>
        <button class="btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_rotenc_params" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
        <a aria-label="帮助" class="config-info-toggle" data-cmd="info-rotaryenc-params" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
        <span id="info-rotaryenc-params" class="config-help-info">
            编码器设置（位置）<br>
            - <b>轮询间隔：</b> 音量更新轮询循环的毫秒休眠时间。默认 = 100。<br>
            - <b>速度因子：</b> 确定使用 1 步或 volume_step 步骤的阈值（前后编码器位置差）。默认 = 2。<br>
            - <b>Volume_step：</b> 当旋钮快速旋转时使用的步骤数。默认 = 3。<br>
            - <b>Pin_A Pin_B：</b> Broadcom SoC 引脚编号。默认 = 23 24。
        </span>
    </div>
</div>


	<div class="control-group">
    <legend>其他外设</legend>

    <div class="$_feat_gpio">
        <label class="control-label">GPIO 按钮</label>
        <div class="controls">
            <div class="toggle">
                <label class="toggle-radio toggle-gpio-svc" for="toggle-gpio-svc-2">开启 </label>$_select[gpio_svc_on]
                <label class="toggle-radio toggle-gpio-svc" for="toggle-gpio-svc-1">关闭</label>$_select[gpio_svc_off]
            </div>
            <button id="btn-set-gpio-svc" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_gpio_svc" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
            <a aria-label="帮助" class="config-info-toggle" data-cmd="info-gpio-svc" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
            <span id="info-gpio-svc" class="config-help-info">
                将附加的硬件按钮映射到 MPD 播放或其他命令。由 @Cyanoazimin 提供。
            </span>
        </div>

        <div class="controls">
            <a href="gpio-config.php"><button class="btn btn-medium btn-primary config-btn">编辑</button></a>
            <span class="config-btn-after">GPIO 引脚映射</span>
        </div>
    </div>

    <label class="control-label">LCD 更新器</label>
    <div class="controls">
        <div class="toggle">
            <label class="toggle-radio toggle-lcdup" for="toggle-lcdup-2">开启 </label>$_select[lcdup_on]
            <label class="toggle-radio toggle-lcdup" for="toggle-lcdup-1">关闭</label>$_select[lcdup_off]
        </div>
        <button id="btn-set-lcdup" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_lcdup" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
        <a aria-label="帮助" class="config-info-toggle" data-cmd="info-lcdup" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
        <span id="info-lcdup" class="config-help-info">
            LCD 更新引擎在 UI 状态变化时运行 lcd-updater.py 脚本。<br>
            一个空的 lcd-updater.py 脚本位于 /var/local/www/commandw/ 目录下。
        </span>


			</div>
		</div>
	</form>
</div>
</div>

<form class="form-horizontal" method="post">
	<div id="restart-localui" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="restart-localui-label" aria-hidden="true">
	<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>是否重启本地显示？</h3>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
    <button class="btn btn-primary btn-submit" type="submit" name="update_restart_localui" value="novalue">是</button>
</div>

	</div>
</form>
